package com.mscsoft.musicscore;

import com.alibaba.fastjson.annotation.JSONField;

/** 谱面元数据 */
public class Meta {
    public final int id;
    @JSONField(ordinal = 1)
    public final int column;
    @JSONField(ordinal = 2)
    public final int level;
    @JSONField(ordinal = 3)
    public final Music music;
    @JSONField(ordinal = 4)
    public final String img;
    @JSONField(ordinal = 5)
    public final String creator;
    @JSONField(ordinal = 6)
    public final long creTime;

    public Meta(int id, int column, int level, Music music, String img, String creator, long creTime) {
        this.id = id;
        this.column = column;
        this.level = level;
        this.music = music;
        this.img = img;
        this.creator = creator;
        this.creTime = creTime;
    }

    @Override
    public int hashCode() {
        return id;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Meta other = (Meta) obj;
        return id == other.id;
    }

    @Override
    public String toString() {
        return "Meta [column=" + column + ", creTime=" + creTime + ", creator=" + creator + ", id=" + id + ", img="
                + img + ", level=" + level + ", music=" + music + "]";
    }

}
